package com.test;

import com.ruoyi.common.utils.ip.IpUtils;
import org.apache.commons.lang3.StringUtils;

import java.sql.SQLOutput;
import java.util.Optional;

public class demo {

    public static void main(String[] args) {

        String s="";

        s=Optional.ofNullable(s)
                .filter(StringUtils::isNoneBlank)
                .map(t -> t="有参")
                .orElseGet(() ->{
                    System.out.println("参数为空或为null");
                    return "赋值新参数";
                });

        System.out.println(s);



    }
}
